﻿#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["src/Mes5GService.Migrator/Mes5GService.Migrator.csproj", "src/Mes5GService.Migrator/"]
COPY ["src/Mes5GService.EntityFrameworkCore/Mes5GService.EntityFrameworkCore.csproj", "src/Mes5GService.EntityFrameworkCore/"]
COPY ["src/Mes5GService.Core/Mes5GService.Core.csproj", "src/Mes5GService.Core/"]
COPY ["src/Mes5GService.Core.Shared/Mes5GService.Core.Shared.csproj", "src/Mes5GService.Core.Shared/"]
RUN dotnet restore "src/Mes5GService.Migrator/Mes5GService.Migrator.csproj"
COPY . .
WORKDIR "/src/src/Mes5GService.Migrator"
RUN dotnet build "Mes5GService.Migrator.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Mes5GService.Migrator.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Mes5GService.Migrator.dll"]
